#!/bin/bash

start_time=$(date +%s) # %s可以计算的是1970年以来的秒数

cd ../build

#for dist in books_200M fb_200M lognormal_200M normal_200M uniform_dense_200M uniform_sparse_200M; do
#for dist in books_200M lognormal_200M normal_200M uniform_dense_200M uniform_sparse_200M; do
for dist in books_200M; do
    ./read_cold -f ../db/sosd/${dist}.txt -k 16 -v 64 -d ../ssd/db_sosd_${dist} -m 7 -w > ../evaluation/sosd_${dist}_put.txt
    ./read_cold -f ../db/sosd/${dist}.txt -k 16 -v 64 -d ../ssd/db_sosd_${dist} -m 7 -u -n 10000 -i 5 --change_level_load $* > ../evaluation/sosd_${dist}_llsm.txt
    ./read_cold -f ../db/sosd/${dist}.txt -k 16 -v 64 -d ../ssd/db_sosd_${dist} -m 8 -u -n 10000 -i 5 $* > ../evaluation/sosd_${dist}_baseline.txt
done

cd ../learned-leveldb/
python3 ./scripts/collect_results.py 5 > ../evaluation/expr_sosd.txt
cat ../evaluation/expr_sosd.txt

end_time=$(date +%s)
cost_time=$((end_time-start_time))
echo "build kernel time is $((cost_time/60))min $((cost_time%60))s"